package com.rescue.controller.user;

import com.rescue.forum.vo.UserAllBoardVO;
import com.rescue.result.Result;
import com.rescue.service.BoardService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@RequestMapping("/user/forum/board")
@RestController("userBoardController")
@Api(tags = "客户端板块相关接口")
@Slf4j
public class BoardController {
    @Autowired
    private BoardService boardService;

    @ApiOperation("客户端查询所用板块信息")
    @GetMapping("/loadBoard")
    private Result<List<UserAllBoardVO>> loadBoard(HttpServletRequest request){

        log.info("用户查询所用板块信息");
        List<UserAllBoardVO> list = boardService.userLoadBoard();
        return Result.success(list);
    }
}
